#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QtGui>
#include <QString>
#include "/windows/D/svn/preplayer/engine_cpp/adaptors.h"
#include "plst.h"
#include "equalizer.h"
#include "vis_draw.h"

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT
    
public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

public slots:
      void slot_play(void);//playback slots
      void slot_play_next(void);
      void slot_play_prev(void);
      void slot_stop(void);
      void slot_pause(void);
      void slot_volume(void);

      void slot_pos_move(void);// position slots
      void slot_playb_timer(void);
      void slot_slide_start(void); //signals of start sliding
      void slot_slide_stop(void); //signals of start sliding

      void slot_plst_dblclk(QListWidgetItem *item);
      void slot_set_eq(void);
      void slot_repaint(void);

protected:
      void keyReleaseEvent(QKeyEvent *);

private:
    Ui::MainWindow *ui;
    HSTREAM hndl;//handle to stream
    plst *playlist;
    QTimer pl_timer, dr_timer;//playback timer
    QDockWidget wdgt;
    Equalizer *eq;
    vis_draw *visualizator;
    unsigned *mywave;
    float *myfft;
    bool playb_sliding, paused;
    void play(QString str);

    void init_connections(void);
    void init_playlist(void);
    void init_timers(void);
    void init_eq(void);
    void init_vis(void);
    int MYWAVE_LEN, MYFFT_LEN;
    //void timer_event(void);
};

#endif // MAINWINDOW_H
